Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZMS fix warnings in compilation #2133

Merged
merged 4 commits into from
Oct 21, 2024
Merged

Conversation

rghaddab
Copy link
Contributor

This PR fixes these compilation warnings:

.../zepyr/subsys/fs/zms/zms.c: In function 'zms_read_hist':
.../zephyr/subsys/fs/zms/zms.c:1655:25: warning: 'rd_addr' may be used uninitialized [-Wmaybe-uninitialized]
1655 | rd_addr &= ADDR_SECT_MASK;
.../zephyr/subsys/fs/zms/zms.c:1590:28: note: 'rd_addr' was declared here
1590 | uint64_t wlk_addr, rd_addr, wlk_prev_addr;
| ^~~~~~~
.../zephyr/subsys/fs/zms/zms.c:1645:12: warning: 'prev_found' may be used uninitialized [-Wmaybe-uninitialized]
1645 | if (((!prev_found) || (wlk_ate.id != id)) || (wlk_ate.len == 0U) || (cnt_his < cnt)) {
| ^
.../zephyr/subsys/fs/zms/zms.c:1589:17: note: 'prev_found' was declared here
1589 | int rc, prev_found;
| ^~~~~~~~~~

It synchronizes as well the downstream code with the upstream PR

ZMS is the abreviation of Zephyr Memory Storage.
It is a storage developed to target especially the non erasable devices.

The new memory storage system inherit from the NVS storage multiple
features and introduce new ones :
* Inherited features :
 - light key-value based storage
 - cache for entries
 - Wear Leveling of flash memory
 - Resilience to power failures
* New features :
 - cycle counter for non erasable devices (instead of erase emulation)
 - Keys up to 32-bit
 - Built-in support of CRC32 for data
 - Small size data (<= 8 bytes) integrated within entries

Upstream PR: zephyrproject-rtos/zephyr#77930

Signed-off-by: Riadh Ghaddab <[email protected]>
(cherry picked from commit 0feaf588f9628e4279001eb390ac07ae1e818f9e)
Introduce ZMS_LOOKUP_CACHE_FOR_SETTINGS Kconfig option that enables a
dedicated hash function for the ZMS lookup cache that takes advantage
of the ZMS ID allocation scheme used by the ZMS settings backend.
As such, this option should only be used if an application uses ZMS via
the settings layer.

Signed-off-by: Riadh Ghaddab <[email protected]>
@rlubos rlubos merged commit 6ccfcdc into nrfconnect:main Oct 21, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants